<?
/*----------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	小飞熊新一代下载系统
          	代码编写：小飞熊	版权所有：小飞熊[L.F.Bear]
				官方网站/技术支持：http://www.bobtail-bear.cn
------------------------------------------------------------------------
          (C) Bobtail-Bear 2006 	L.F.Bear's New Download Sysytem
          	Powered by L.F.Bear  Copyright L.F.Bear's Home(R)
               Official Web/Support：http://www.bobtail-bear.cn
-----------------------------------------------------------------------*/

//本页脚本功能：文章显示页面
$thispage="news.php";
$searchbar="y";
require("header.php"); 
$id=$_GET[id];
//防止恶意刷新代码
$timestamp=time();
$cookietime = $timestamp+3153600;
if ($REQUEST_URI == $_COOKIE['lastpath'] && ($timestamp-$_COOKIE['lastvisit']<$dis_reload) && $id==$_COOKIE['nid']) 
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[24];
$fb_msg=$p_lang[25].$dis_reload.$p_lang[26]." !";
$fb_link="index.php";
require("feedback.php");
}
setcookie('lastpath', $REQUEST_URI, $cookietime);
setcookie('lastvisit', $timestamp, $cookietime);
setcookie('nid', $id, $cookietime);

//测试文章是否存在
$file_path=$path_news."/".$id.".php";
if(!file_exists($file_path))
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[24];
$fb_msg=$p_lang[27];
$fb_link="index.php";
require("feedback.php");
}

//调入文章信息
$news_info=readf($file_path);
$news_info=explode("|",$news_info);
showclassname($news_info[6],$news_info[7]);

if($news_info[3]=="" || $news_info[1]==-1)
{
$fb_title1=$p_lang[23];
$fb_title2=$p_lang[24];
$fb_msg=$p_lang[27];
$fb_link="index.php";
require("feedback.php");
}

//调入文章TOP10
$td_news_info=@file("cache/top_news.php");
$td_show_news="<table width=\"175\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";

for($dn_news=0;$dn_news<count($td_news_info);$dn_news++)
{
unset($tempy);
$tempy=explode("|",$td_news_info[$dn_news]);
$td_show_news.="<li><a href=news.php?id=$tempy[0] title=\"$tempy[1]\"> $tempy[1] </a></li>";
}
if(count($td_news_info)==0) $td_show_news.=$p_lang[1];

$td_show_news.="</td></tr></table>";

//用户登陆
if($users=="n")
{
$div=f_l_list(2);
$skip=1;
}
if($skip!=1 && $_SESSION[f_login]=="yes" && $_COOKIE[l_state]=="ok")
$div=f_l_list(1);
elseif($skip!=1 && ($_SESSION[f_login]!="yes" || $_COOKIE[l_state]!="ok"))
$div=f_l_list(0);

$cfile_path1=$path_news."/click/".$id.".brt";
if(!file_exists($cfile_path1)) {$t_msg[0]=0;writef($cfile_path1,"1","w");}
else {$brt=readf($cfile_path1); $t_msg[0]=$brt;$brt++;writef($cfile_path1,$brt,"w");}

$t_msg[1]=view_ad($news_info[21]);

$t_msg[2]=view_ad($news_info[22],0);

	require("template.php");
	$page = new SmartTemplate( "news.html" );
	$page->assign('div',$div);
	$page->assign('td_show_news',$td_show_news);
	$page->assign('news_info',$news_info);
	$page->assign('t_msg',$t_msg);
	$page->assign('imagepath',$imagepath);
	$page->assign('t_lang',$t_lang);
	$page->output();

require("footer.php");
die(); 
?>